package com.huang.controller;

import com.huang.common.utils.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 黄自祥
 * @date 2022/01/16 14:16
 * @Description:
 */
@RestController
@RequestMapping("/redis")
public class RedisController {

    @Autowired
    RedisUtils redisUtils;
    @GetMapping("/getValueByKey/{key}")
    public Object getValueByKey(@PathVariable String key){
//        StringRedisTemplate
        Object o = redisUtils.get(key);
        return o;
    }

    @PostMapping("/setVale")
    public void setVale( String key, String value){
//        StringRedisTemplate
         redisUtils.set(key,value);
    }

}
